package org.hackystat.ui.projectviewer.gwt.server.etl;

import java.util.Date;

/**
 * Primitive for data point.
 * 
 * @author Pavel Senin.
 * 
 */
public class DataPoint {
  private Date timeStamp;
  private Double value;

  /**
   * Instantiates the point.
   * 
   * @param tStamp The time stamp.
   * @param value The payload.
   */
  public DataPoint(Date tStamp, String value) {
    this.timeStamp = tStamp;
    if (null == value) {
      this.value = null;
    }
    else {
      this.value = Double.valueOf(value);
    }
  }

  /**
   * Reports the timestamp.
   * 
   * @return The timestamp.
   */
  public Date getTStamp() {
    return this.timeStamp;
  }

  /**
   * Reports the stored value.
   * 
   * @return The stored value.
   */
  public Double getValue() {
    return this.value;
  }
}
